home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_usrdoc / SPLITVT / EXAMPLES / MENU < prev    next >
Text File  |  1999-09-17  |  1KB  |  50 lines

  1. #!/bin/sh
  2. #
  3. #    An example menu utilizing the SPLITVT environment variable.
  4. #
  5.  
  6. # Portably echo a line with no trailing newline:
  7. echo_n() {
  8.     if [ "`echo -n \"\"`" = "" ]; then
  9.         echo -n "$*"
  10.     elif [ "`echo -e \"\\c\"`" == "" ]; then
  11.         echo -e "$*\c"
  12.     else 
  13.         echo "$*\c"
  14.     fi
  15. }
  16.  
  17. if [ "$SPLITVT" = "upper" ]; then
  18.     echo "This is the upper window MENU:"
  19.     echo ""
  20.     echo "1)    apples"
  21.     echo "2)    oranges"
  22.     echo "3)    bananas"
  23.     echo ""
  24.     echo_n "Enter your fruit of choice: "
  25.     read fruit
  26.     case $fruit in
  27.         1)    echo "You like apples!";;
  28.         2)    echo "You like oranges!";;
  29.         3)    echo "You like bananas!";;
  30.         *) echo "What fruit was that?";;
  31.     esac
  32. elif [ "$SPLITVT" = "lower" ]; then
  33.     echo "This is the lower window MENU:"
  34.     echo ""
  35.     echo "1)    pickles"
  36.     echo "2)    carrots"
  37.     echo "3)    cabbage"
  38.     echo ""
  39.     echo_n "Enter your vegetable of choice: "
  40.     read fruit
  41.     case $fruit in
  42.         1)    echo "You like pickles!";;
  43.         2)    echo "You like carrots!";;
  44.         3)    echo "You like cabbage!";;
  45.         *) echo "What vegetable was that?";;
  46.     esac
  47. else
  48.     echo "You are not running splitvt!"
  49. fi
  50.